package com.ityunhe.bean;

import java.util.List;
import java.util.Map;

public class Page<T> {
	
	
	//每页的大小
	private int  pageSize=10;
	//第几页
	private int pageIndex=1;
	//总记录数
	private int totleCount;
	//总页数
	private int totlePage;
	//集合
	private  List<T>  list;
	
	
	@Override
	public String toString() {
		return "Page [pageSize=" + pageSize + ", pageIndex=" + pageIndex
				+ ", totleCount=" + totleCount + ", totlePage=" + totlePage
				+ ", list=" + list + "]";
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}
	public int getTotleCount() {
		return totleCount;
	}
	public void setTotleCount(int totleCount) {
		this.totleCount = totleCount;
		
		this.totlePage=(this.totleCount%this.pageSize==0)?this.totleCount/this.pageSize:this.totleCount/this.pageSize+1;
	}
	public int getTotlePage() {
		return totlePage;
	}
	public void setTotlePage(int totlePage) {
		this.totlePage = totlePage;
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public Page(int pageSize, int pageIndex, int totleCount, int totlePage,
			List<T> list) {
		super();
		this.pageSize = pageSize;
		this.pageIndex = pageIndex;
		this.totleCount = totleCount;
		this.totlePage = totlePage;
		this.list = list;
	}
	public Page() {
		super();
		// TODO Auto-generated constructor stub
	}
}
